<?php 
defined('RUN_KATANA') or die('Restricted access');
$com->setButtonsContent(array 
(
	0 => array 
	(	
		'title' => '&lt;&lt;&nbsp;'.ucfirst($txt->getWord('cancel')),
		'href' => '/c/11/?edit=ad&ad='.$shop->getCurrentOrder()->getAdId()
	),
	1 => array 
	(	
		'title' => ucfirst($txt->getWord('complete_your_order').' &nbsp;&gt;&gt;'),
		'href' => '',
		'onclick' => 'document.getElementById(\'complete\').value=1; document.getElementById(\''.$com->Id.'_payment\').submit();',
	)
));
?>
<div>
<form id="<?php echo $com->Id; ?>_payment" action="" method="post" enctype="multipart/form-data" name="payment">
<?php 
if(is_object($shop->getCurrentOrder())): 
?>

<table class="com_form" width="100%" cellspacing="0" cellpadding="0" border="0">
    <thead>
    	<tr>
            <th class="small"><h2><?php echo ucfirst($txt->getWord('order_information')); ?></h2></th>
            <th></th>
        </tr>
        <tr>
            <th class="small"><h3><?php echo ucfirst($txt->getWord('customer')); ?></h3></th>
            <th></th>
        </tr>
    </thead>
    <tbody>
    	<tr>
            <td><?php echo ucfirst($txt->getWord('name')); ?></td>
            <td><?php echo $shop->getCurrentOrder()->getBillingName(); ?></td>
        </tr>
        <tr>
            <td><?php echo ucfirst($txt->getWord('lastname')); ?></td>
            <td><?php echo $shop->getCurrentOrder()->getBillingLastName(); ?></td>
        </tr>
        <?php if($shop->getCurrentOrder()->getBillingCompany() != ''): ?>
        <tr>
            <td><?php echo ucfirst($txt->getWord('company')); ?></td>
            <td><?php echo $shop->getCurrentOrder()->getBillingCompany(); ?></td>
        </tr>
        <?php endif; ?>
        <tr>
            <td><?php echo ucfirst($txt->getWord('address')); ?></td>
            <td><?php echo $shop->getCurrentOrder()->getBillingAddress(); ?></td>
        </tr>
        <?php if($shop->getCurrentOrder()->getBillingAddress2() != ''): ?>
        <tr>
            <td><?php echo ucfirst($txt->getWord('address')); ?> 2</td>
            <td><?php echo $shop->getCurrentOrder()->getBillingAddress2(); ?></td>
        </tr>
        <?php endif; ?>
        <tr>
            <td><?php echo ucfirst($txt->getWord('zip')); ?></td>
            <td><?php echo $shop->getCurrentOrder()->getBillingZip(4); ?></td>
        </tr>
        <tr>
            <td><?php echo ucfirst($txt->getWord('city')); ?></td>
            <td><?php echo $shop->getCurrentOrder()->getBillingCity(); ?></td>
        </tr>
        <?php if($shop->getCurrentOrder()->getBillingEmail() != ''): ?>
        <tr>
            <td><?php echo ucfirst($txt->getWord('e-mail')); ?></td>
            <td><?php echo $shop->getCurrentOrder()->getBillingEmail(); ?></td>
        </tr>
        <?php endif; ?>
        <?php if($shop->getCurrentOrder()->getBillingPhone() != ''): ?>
        <tr>
            <td><?php echo ucfirst($txt->getWord('phone')); ?></td>
            <td><?php echo $shop->getCurrentOrder()->getBillingPhone(); ?></td>
        </tr>
        <?php endif; ?>
        <tr>
        	<td colspan="2"><a href="/c/11">[<?php echo ucfirst($txt->getWord('change')); ?>]</a></td>
        </tr>
        <?php if($shop->getCurrentOrder()->getPaymentID() > 0): ?>
        <tr><td colspan="2"><hr /></td></tr>
        <tr>
            <td class="small" align="left"><h3><?php echo ucfirst($txt->getWord('payment_method')); ?></h3></td>
        </tr>
        <tr>
            <td><?php echo $shop->getCurrentOrder()->getPaymentTitle(); ?></td>
        </tr>
<?php endif; ?>
    </tbody>
</table><hr />
<?php 
$items = $shop->getCurrentOrder()->getOrderItems();
?>
<table id="order_info" class="com_form" width="100%" cellspacing="0" cellpadding="0" border="0" style="display:<?php echo $display; ?>;">
<thead>
    <tr>
        <th colspan="6"><br /><h3><?php echo ucfirst($txt->getWord('products')); ?></h3></th>
    </tr>
    <tr>
        <th><?php echo ucfirst($txt->getWord('product_description')); ?></th>
        <th class="right"><?php echo ucfirst($txt->getWord('price_per_unit')); ?></th>
        <th class="right"><?php echo $txt->getWord('vat'); ?></th>
        <th class="right"><?php echo ucfirst($txt->getWord('full').' '.$txt->getWord('price')); ?></th>
        <th class="right"><?php echo ucfirst($txt->getWord('count')); ?></th>
        <th class="right"><?php echo ucfirst($txt->getWord('total')); ?></th>
    </tr>
    <tr>
        <th colspan="6"><br /></th>
    </tr>
</thead>
<?php if($items): ?>
<tbody>
<?php 
    foreach($items as $item)
    { 
        ?>
        <tr>
            <td valign="top" class="xlarge" style="padding-bottom:4px;">
                <?php echo $item->getItemTitle(); ?>&nbsp;
                <?php 
                    if(($item->getItemVarTitle() != '') && ($item->getItemVarTitle() != 'Standard')) 
                    { echo '<br />'.$item->getItemVarTitle(); } 
					if($item->getItemText() != '')
					{ echo '<br />'.ucfirst($txt->getWord('text')).': '.$item->getItemText(); }
					if($shop->getCurrentOrder()->getAdId() > 0)
					{ echo '<br />'.ucfirst($txt->getWord('ad').' '.$txt->getWord('code')).': '.$shop->getCurrentOrder()->getAdId(); }
				?>
            </td>
            <td valign="top" class="right"><?php echo number_format($item->getSingleItemPrice(2),2,',',' '); ?> kr.</td>
            <td valign="top" class="right"><?php echo number_format($item->getSingleItemTax(2),2,',',' '); ?> kr.</td>
            <td valign="top" class="right"><?php echo number_format($item->getSingleItemPriceTotal(1),2,',',' '); ?> kr.</td>
            <td valign="top" class="right"><?php echo $item->getCount(); ?></td>
            <td valign="top" class="right"><?php echo number_format($item->getTotalItemPriceTotal(1),2,',',' '); ?> kr.</td>
        </tr>
        <?php
    }
    ?>
    <tr>
        <td colspan="6">&nbsp;</th>
    </tr>
</tbody>
<tfoot>
    <tr>
        <td class="first bold" style="padding-bottom:4px;">Sum <?php echo ucfirst($txt->getWord('products')); ?>:</td>
        <td class="bold right" style="padding-bottom:4px;"><?php echo number_format($shop->getCurrentOrder()->getCostItems(2),2,',',' '); ?> kr.</td>
        <td class="bold right" style="padding-bottom:4px;"><?php echo number_format($shop->getCurrentOrder()->getCostItemsVat(2),2,',',' '); ?> kr.</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td class="last bold right" style="padding-bottom:4px;"><?php echo number_format($shop->getCurrentOrder()->getCostItemsTotal(1),2,',',' '); ?> kr.</td>
    </tr>
    <tr>
        <td colspan="5" class="first bold underline" style="padding:10px 0px;"><?php echo ucfirst($txt->getWord('order_total')); ?>:</td>
        <td class="bold underline right">
            <?php echo number_format($shop->getCurrentOrder()->getCostTotal(1),2,',',' '); ?> kr.
        </td>
    </tr>
    <tr>
        <td style="padding:10px 0px;"><br /><?php echo getButtonsHTML($theme->HFBSets[$theme->ComHFB]['button'], $com->getButtonsContent()); ?></td>
    </tr>
</tfoot>
<?php endif; ?>
</table><br /><br />
<?php endif; ?>
<input type="hidden" name="orderid" value="<?php echo $shop->getCurrentOrder()->getId(); ?>" />
<input id="action" type="hidden" name="action" value="payment" />
<input id="complete" type="hidden" name="complete" value="0" />
<input type="hidden" name="shipping_method" value="<?php echo $shop->getCurrentOrder()->getShippingID(); ?>" />
<input type="hidden" name="payment_method" value="<?php echo $shop->getCurrentOrder()->getPaymentID(); ?>" />
<input id="<?php echo $com->Id; ?>_payment_stealth" type="hidden" name="stealth_<?php echo md5(date("m-d-w")); ?>" value="" />
</form>
</div>